package org.supda.system.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;
/**
 * 
 * @author supda
 * @Date 2016-11-11 下午3:46:14
 *
 */
public class PasswordUtil {

	/**
	 * User密码生成算法
	 * @param pwd
	 * @param salt
	 * @return
	 * 
	 * 登录密码 salt= accountName+credsalt; 
	 */
	public static String getPassword(String pwd , String salt){
		 return new SimpleHash("md5",pwd,ByteSource.Util.bytes(salt),2).toHex(); 
	}
	
	public static void main(String[] args) {
		System.out.println(getPassword("123456", "admin4157c3feef4a6ed91b2c28cf4392f2d1"));
	}
}
